# -*- coding: utf-8 -*-
"""
@Time ： 2025/8/27 14:58
@Auth ： 李天天
"""
import time

from PageLocators.MinePage_locator import MinePageLocator as loc

from Common.basepage import BasePage


class MinePage(BasePage):

    def click_history(self):
        self.click_by_text("观看历史", tag="span")

    def click_collection(self):
        self.click_by_text("我的收藏", tag="span")

    def click_settings(self):
        self.click_by_text("设置", tag="span")

    def click_back(self):
        self.click_element(loc.back_loc, img_desc="点击返回")


if __name__ == '__main__':
    from Common.browser_config import quick_start
    from PageObjects.Main_Page import MainPage

    pw, browser, context, page = quick_start(auto_login=True)
    do_mainpage = MainPage(page)
    do_minepage = MinePage(page)
    # # main_page.goto("https://www.iqiyi.com/iv0401#/?ver=tesla")
    do_mainpage.goto("https://www.iqiyi.com/iv#/?ver=tesla")
    time.sleep(5)
    do_mainpage.click_personal_center()
    # time.sleep(3)
    # do_minepage.click_history()
    # time.sleep(3)
    # do_minepage.click_back()
    # time.sleep(3)
    # do_minepage.click_collection()
    # time.sleep(3)
    # do_minepage.click_back()
    # time.sleep(3)
    do_minepage.click_settings()
    time.sleep(3)
    do_minepage.click_back()
    time.sleep(3)

